// components/search/module/sMoney/sMoney.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    data: {
      type: Object,
      value: () => {
        return {};
      },
    },
    start: {
      type: String,
      value: "",
    },
    end: {
      type: String,
      value: "",
    },
  },
  observers: {
    start(v){
      this.setData({
        ['insideValue[0]']: v,
      })
    },
    end(v){
      this.setData({
        ['insideValue[1]']: v,
      })
    },
  },
  /**
   * 组件的初始数据
   */
  data: {
    insideValue: [],
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getValue(e) {
      let i = e.currentTarget.dataset.index
      let key = `insideValue[${i}]`
      this.setData({
        [key]: e.detail.value,
      });
      this.triggerEvent("value", {
        type: this.data.data.names[i],
        value: e.detail.value,
      });
    },
  },
});
